//
//  SimpleButtonView.swift
//  SwiftUIButton
//
//  Created by 李煜 on 2024/7/30.
//

import SwiftUI

struct SimpleButtonView: View {
    var body: some View{
        // 按钮写法1
        Button(action: {
            print("点击了按钮1")
        }, label: {
            Text("按钮1")
        })
        
        //按钮写法2
        Button{
            print("点击了按钮2")
        }label: {
            Text("按钮2")
        }
    }
}
#Preview {
    SimpleButtonView()
}
